API Documentation
FreeListPager.h
1 // FreeListPager.h
3 //
5 
6 namespace nkMemory
7 {
11  template <typename T>
13  {
18 
23  size_t _index ;
24  } ;
25 }
26 
27 namespace nkMemory
28 {
41  template <typename T = char*, typename U = DefaultMemorySpace>
42  class FreeListPager final
43  {
44  public :
45 
51  FreeListPager (size_t pageSize) ;
52 
56  ~FreeListPager () = default ;
57 
58  // Getters
62  size_t getPageSize () const ;
66  size_t getAllocatedPageCount () const ;
70  const FreeListMemorySpaceWrapper<T, U>& getPage (size_t index) ;
71 
72  // Allocations
82  FreeListAllocation<T> allocate (size_t size, size_t alignment = 1) ;
88  void free (size_t allocationIndex) ;
89  } ;
90 }
nkMemory::FreeListPager::FreeListPager
FreeListPager(size_t pageSize)
nkMemory::FreeListPager::getPageSize
size_t getPageSize() const
nkMemory::FreeListPager::allocate
FreeListAllocation< T > allocate(size_t size, size_t alignment=1)
nkMemory::FreeListPager
A pager implementing the free list pattern.
Definition: FreeListPager.h:43
nkMemory::FreeListAllocation::_index
size_t _index
Definition: FreeListPager.h:23
nkMemory::FreeListPager::getPage
const FreeListMemorySpaceWrapper< T, U > & getPage(size_t index)
nkMemory::FreeListPager::free
void free(size_t allocationIndex)
nkMemory::FreeListPager::~FreeListPager
~FreeListPager()=default
nkMemory::FreeListPager::getAllocatedPageCount
size_t getAllocatedPageCount() const
nkMemory::FreeListAllocation
Holds information about an allocation returned by the pager.
Definition: FreeListPager.h:13
nkMemory::FreeListAllocation::_allocation
T _allocation
Definition: FreeListPager.h:17
nkMemory
Encompasses all API of component NilkinsMemory.
Definition: Allocator.h:7